home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q32555 < prev    next >
Text File  |  1988-07-21  |  1KB  |  51 lines

  1. Q32555 Multi-Thread pow Function Fails when Raising Negative Number
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    The pow function in the multi-thread library LLIBCMT.LIB will fail
  8. when attempting to raise a negative number to a positive integer
  9. power.
  10.    Microsoft has confirmed this to be a problem in Version 5.10
  11. of the C compiler. We are researching this problem and will post new
  12. information as it becomes available.
  13.  
  14. More Infaormation:
  15.    The following program illustrates this problem:
  16.  
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19.  
  20. void main( void );
  21. void test( double, double, double );
  22.  
  23.  
  24. void main()
  25. {
  26.  
  27.     printf( "Test starting.\n" );
  28.  
  29.     test( -1.0, 2.0, 1.0 );
  30.  
  31.     printf( "Test done.\n" );
  32.  
  33. }
  34.  
  35. void test( double x, double y, double answer )
  36. {
  37. double  z;
  38.  
  39.     z = pow( x, y );
  40.  
  41.     if( z != answer ){
  42.         printf( "Error: pow( %g, %g ) != %g\n", x, y, answer );
  43.         exit( 1 );
  44.         }
  45. }
  46.  
  47.  
  48.  
  49. Keywords:  buglist5.10 qfbv
  50. Updated  88/07/21 03:19
  51.